{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "from icepyx import icesat2data as ipd"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Setting the data product, region, time, NSIDC user id/email and download directory"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "metadata": {},
   "outputs": [],
   "source": [
    "shortName = 'ATL07'\n",
    "# --- lon/lat of lower left and upper right of the Saildrone domain Corner\n",
    "bbox     = [-157.5,73,-152,75.4]\n",
    "dates    = ['2019-08-01','2019-08-31']\n",
    "\n",
    "#dates    = ['2019-07-01','2019-07-31']\n",
    "#bbox     = [-166.5,70.5,-156,73.5]\n",
    "\n",
    "#dates    = ['2019-06-01','2019-06-30']\n",
    "#bbox     = [-169,62,-159,72]\n",
    "\n",
    "uid      = 'dzhangpmel'\n",
    "email    = 'dongxiao.zhang@noaa.gov'\n",
    "\n",
    "dataroot = '/home/jovyan/shared/data-overcast/CHUKCHI'\n",
    "datapath = os.path.join(dataroot,shortName)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "metadata": {},
   "outputs": [],
   "source": [
    "region_b = ipd.Icesat2Data(shortName,bbox,dates,start_time='00:00:00', end_time='23:59:59')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "metadata": {},
   "outputs": [
    {
     "name": "stdin",
     "output_type": "stream",
     "text": [
      "Earthdata Login password:  ········\n"
     ]
    }
   ],
   "source": [
    "region_b.earthdata_login(uid,email)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Check the granules in this box and time range. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Number of available granules': 21,\n",
       " 'Average size of granules (MB)': 43.503247760600004,\n",
       " 'Total size of all granules (MB)': 913.5682029726}"
      ]
     },
     "execution_count": 71,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "region_b.avail_granules()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['ATL07-01_20190731234707_05180401_003_02.h5',\n",
       " 'ATL07-01_20190804000427_05640401_003_02.h5',\n",
       " 'ATL07-01_20190804110429_05710401_003_02.h5',\n",
       " 'ATL07-01_20190804233848_05790401_003_02.h5',\n",
       " 'ATL07-01_20190807235607_06250401_003_02.h5',\n",
       " 'ATL07-01_20190808105608_06320401_003_02.h5',\n",
       " 'ATL07-01_20190808233027_06400401_003_02.h5',\n",
       " 'ATL07-01_20190812104749_06930401_003_02.h5',\n",
       " 'ATL07-01_20190812232208_07010401_003_02.h5',\n",
       " 'ATL07-01_20190813102210_07080401_003_02.h5',\n",
       " 'ATL07-01_20190816103930_07540401_003_02.h5',\n",
       " 'ATL07-01_20190816231349_07620401_003_02.h5',\n",
       " 'ATL07-01_20190817101351_07690401_003_02.h5',\n",
       " 'ATL07-01_20190820103112_08150401_003_02.h5',\n",
       " 'ATL07-01_20190820230531_08230401_003_02.h5',\n",
       " 'ATL07-01_20190821100533_08300401_003_02.h5',\n",
       " 'ATL07-01_20190824225712_08840401_003_02.h5',\n",
       " 'ATL07-01_20190825095714_08910401_003_02.h5',\n",
       " 'ATL07-01_20190828224852_09450401_003_02.h5',\n",
       " 'ATL07-01_20190829094853_09520401_003_02.h5',\n",
       " 'ATL07-01_20190829222313_09600401_003_02.h5']"
      ]
     },
     "execution_count": 72,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "region_b.avail_granules(ids=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### No subsetting of variables for now. Order and download"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Total number of data order requests is  3  for  21  granules.\n",
      "Data request  1  of  3  is submitting to NSIDC\n",
      "order ID:  5000000701241\n",
      "Initial status of your order request at NSIDC is:  processing\n",
      "Your order status is still  processing  at NSIDC. Please continue waiting... this may take a few moments.\n",
      "Your order is:  failed\n",
      "NSIDC provided these error messages:\n",
      "['181324008:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " '181323776:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " '181321143:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " '181321133:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " '181321392:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " '181321380:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " '181321264:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " '181450573:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " '181450556:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " '181450814:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " 'PT6.859S',\n",
      " 'ICESAT2']\n",
      "Request failed.\n",
      "Data request  2  of  3  is submitting to NSIDC\n",
      "order ID:  5000000701243\n",
      "Initial status of your order request at NSIDC is:  processing\n",
      "Your order status is still  processing  at NSIDC. Please continue waiting... this may take a few moments.\n",
      "Your order is:  failed\n",
      "NSIDC provided these error messages:\n",
      "['181323180:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " '181323193:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " '181322883:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " '181323905:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " '181323981:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " '181323649:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " '181324706:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " '181324582:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " '181324915:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " '181325005:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " 'PT6.832S',\n",
      " 'ICESAT2']\n",
      "Request failed.\n",
      "Data request  3  of  3  is submitting to NSIDC\n",
      "order ID:  5000000701245\n",
      "Initial status of your order request at NSIDC is:  processing\n",
      "Your order status is still  processing  at NSIDC. Please continue waiting... this may take a few moments.\n",
      "Your order is:  failed\n",
      "NSIDC provided these error messages:\n",
      "['181450465:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " 'PT3.467S',\n",
      " 'ICESAT2']\n",
      "Request failed.\n"
     ]
    },
    {
     "ename": "AttributeError",
     "evalue": "'Granules' object has no attribute 'orderIDs'",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mAttributeError\u001b[0m                            Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-73-66745b4dd6fc>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0;31m# --- set email=False to avoid flooding your inbox\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mregion_b\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0morder_granules\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0memail\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;32m/srv/conda/envs/notebook/lib/python3.7/site-packages/icepyx/core/icesat2data.py\u001b[0m in \u001b[0;36morder_granules\u001b[0;34m(self, verbose, subset, email, **kwargs)\u001b[0m\n\u001b[1;32m    681\u001b[0m         \u001b[0;31m#REFACTOR: add checks here to see if the granules object has been created, and also if it already has a list of avail granules (if not, need to create one and add session)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    682\u001b[0m         \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mhasattr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'_granules'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mgranules\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 683\u001b[0;31m         \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_granules\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mplace_order\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mCMRparams\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mreqparams\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msubsetparams\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mverbose\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msubset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msession\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_session\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgeom_filepath\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_geom_filepath\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    684\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    685\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/srv/conda/envs/notebook/lib/python3.7/site-packages/icepyx/core/granules.py\u001b[0m in \u001b[0;36mplace_order\u001b[0;34m(self, CMRparams, reqparams, subsetparams, verbose, subset, session, geom_filepath)\u001b[0m\n\u001b[1;32m    300\u001b[0m         \u001b[0;31m# --- Output the final orderIDs\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    301\u001b[0m         \u001b[0;32mwith\u001b[0m \u001b[0mopen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0morder_fn\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m'w'\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mfid\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 302\u001b[0;31m             \u001b[0mjson\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdump\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m{\u001b[0m\u001b[0;34m'orderIDs'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0morderIDs\u001b[0m\u001b[0;34m}\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mfid\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    303\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    304\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mAttributeError\u001b[0m: 'Granules' object has no attribute 'orderIDs'"
     ]
    }
   ],
   "source": [
    "# --- set email=False to avoid flooding your inbox\n",
    "region_b.order_granules(email=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Total number of data order requests is  3  for  21  granules.\n",
      "Data request  1  of  3  is submitting to NSIDC\n",
      "order ID:  5000000701247\n",
      "Initial status of your order request at NSIDC is:  processing\n",
      "Your order status is still  processing  at NSIDC. Please continue waiting... this may take a few moments.\n",
      "Your order is:  failed\n",
      "NSIDC provided these error messages:\n",
      "['181324008:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " '181323776:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " '181321143:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " '181321133:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " '181321392:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " '181321380:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " '181321264:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " '181450573:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " '181450556:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " '181450814:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " 'PT3.430S',\n",
      " 'ICESAT2']\n",
      "Request failed.\n",
      "Data request  2  of  3  is submitting to NSIDC\n",
      "order ID:  5000000701249\n",
      "Initial status of your order request at NSIDC is:  processing\n",
      "Your order status is still  processing  at NSIDC. Please continue waiting... this may take a few moments.\n",
      "Your order is:  failed\n",
      "NSIDC provided these error messages:\n",
      "['181323180:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " '181323193:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " '181322883:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " '181323905:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " '181323981:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " '181323649:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " '181324706:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " '181324582:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " '181324915:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " '181325005:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " 'PT3.290S',\n",
      " 'ICESAT2']\n",
      "Request failed.\n",
      "Data request  3  of  3  is submitting to NSIDC\n",
      "order ID:  5000000701251\n",
      "Initial status of your order request at NSIDC is:  processing\n",
      "Your order status is still  processing  at NSIDC. Please continue waiting... this may take a few moments.\n",
      "Your order is:  failed\n",
      "NSIDC provided these error messages:\n",
      "['181450465:NoMatchingData - No data found that matched subset constraints. '\n",
      " 'Exit code 3.',\n",
      " 'PT2.739S',\n",
      " 'ICESAT2']\n",
      "Request failed.\n"
     ]
    },
    {
     "ename": "AttributeError",
     "evalue": "'Granules' object has no attribute 'orderIDs'",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mAttributeError\u001b[0m                            Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-74-df10be87339c>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mregion_b\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdownload_granules\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdatapath\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;32m/srv/conda/envs/notebook/lib/python3.7/site-packages/icepyx/core/icesat2data.py\u001b[0m in \u001b[0;36mdownload_granules\u001b[0;34m(self, path, verbose, subset, restart, **kwargs)\u001b[0m\n\u001b[1;32m    738\u001b[0m             \u001b[0;32mpass\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    739\u001b[0m         \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 740\u001b[0;31m             \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mhasattr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_granules\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'orderIDs'\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_granules\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0morderIDs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m==\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0morder_granules\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mverbose\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mverbose\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msubset\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0msubset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    741\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    742\u001b[0m         \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_granules\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdownload\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mverbose\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpath\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msession\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_session\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mrestart\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mrestart\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/srv/conda/envs/notebook/lib/python3.7/site-packages/icepyx/core/icesat2data.py\u001b[0m in \u001b[0;36morder_granules\u001b[0;34m(self, verbose, subset, email, **kwargs)\u001b[0m\n\u001b[1;32m    681\u001b[0m         \u001b[0;31m#REFACTOR: add checks here to see if the granules object has been created, and also if it already has a list of avail granules (if not, need to create one and add session)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    682\u001b[0m         \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mhasattr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'_granules'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mgranules\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 683\u001b[0;31m         \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_granules\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mplace_order\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mCMRparams\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mreqparams\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msubsetparams\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mverbose\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msubset\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msession\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_session\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgeom_filepath\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_geom_filepath\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    684\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    685\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/srv/conda/envs/notebook/lib/python3.7/site-packages/icepyx/core/granules.py\u001b[0m in \u001b[0;36mplace_order\u001b[0;34m(self, CMRparams, reqparams, subsetparams, verbose, subset, session, geom_filepath)\u001b[0m\n\u001b[1;32m    300\u001b[0m         \u001b[0;31m# --- Output the final orderIDs\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    301\u001b[0m         \u001b[0;32mwith\u001b[0m \u001b[0mopen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0morder_fn\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m'w'\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mfid\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 302\u001b[0;31m             \u001b[0mjson\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdump\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m{\u001b[0m\u001b[0;34m'orderIDs'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0morderIDs\u001b[0m\u001b[0;34m}\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mfid\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    303\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    304\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mAttributeError\u001b[0m: 'Granules' object has no attribute 'orderIDs'"
     ]
    }
   ],
   "source": [
    "region_b.download_granules(datapath)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python [conda env:notebook] *",
   "language": "python",
   "name": "conda-env-notebook-py"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
